<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">    <link rel="stylesheet" href="jgp/css/project/ui-color-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-list-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-input-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-btn-v3.css">
    <link rel="stylesheet" href="jgp/css/project/ui-res-v3.css">
    <link rel="stylesheet" href="jgp/css/ui-color.css">
    <link rel="stylesheet" href="jgp/css/ui-res.css">
    <link rel="stylesheet" href="jgp/css/ui-input.css">
    <link rel="stylesheet" href="jgp/css/ui-base.css">
    <link rel="stylesheet" href="jgp/css/ui-box.css">
    <link rel="stylesheet" href="jgp/css/project/style.css">
	<link rel="stylesheet" href="jgp/css/my.css">
	<link rel="stylesheet" href="jgp/css/iBox.css">
	
	
	<script src="jgp/js/zy_tmpl.js"></script>
	<script src="jgp/js/zy_control.js"></script>
    <script src="jgp/js/zy_click.js"></script>
    <script src="jgp/js/common.js"></script>
    <script src="jgp/js/zy_json.js"></script>
    <script src="jgp/js/zy_event.js"></script>
	<script src="jgp/js/peibeidan.js"></script>
	<script src="jgp/js/jquery-1.8.3.min.js"></script>
	<script src="jgp/js/pbd.js"></script>
	<script src="jgp/js/iBox.js"></script>
	<script src="js/talkingdata.js"></script>
</head>
<body id="body" class="um-vp  ub-ver " ontouchstart>
	<div  class="ub ub-ver " id="div1">
		<div class=" uinn " id="cont3" >
		</div>
	</div>
	<div id="diyLoadDiv" class="uhide"></div>
</body>
<script>
zy_init();
window.uexOnload=function(type){
	if(!type){
//        loadingStart("加载中...", 0);
		intConter();
		IC.talkingDataCount("机供品","0005");
//	     $("#cont3").height($$("body").offsetHeight);
//		uexWindow.setBounce("1");
//		uexWindow.showBounceView("0", "rgba(255,255,255,0)", "0");
//        uexWindow.showBounceView("1", "rgba(255,255,255,0)", "0");
	}
}
	/****************更改提交进行数据统计**************/
	function updateDate1(){
		IC.talkingDataCount("机供品","0005");
		var tdcarray = JSON.parse(getStorage("pbdxdArry"));
			var qf=null;
		for (var i = 0; i < tdcarray.length; i++) {
			 var F_ZBID =tdcarray[i].F_ZBID;
			 var F_WZMC = tdcarray[i].F_WZMC;
			 var F_CKSL_TDC = tdcarray[i].F_CKSL_TDC;
			 var F_DY_TDC=tdcarray[i].F_DY_TDC;
			 var F_JLDW = tdcarray[i].F_JLDW;
			 var F_WZID = tdcarray[i].F_WZID;
			 var F_DY_TDC1 = F_DY_TDC;
					if (F_DY_TDC.indexOf("/") > 0) {
					  qf=F_DY_TDC.split('/');
					 F_DY_TDC1=parseInt(qf[0])+parseInt(qf[1]);
					}
//			var jsonData = new Array();		
			$("#cont3 input").each(function(){
				var id = $(this).attr("id");
				if (id.indexOf("yin") < 0) {
					if (id == F_WZID) {
						if (F_DY_TDC1 != $(this).val()) {
							var F_QTSL_TDC = $(this).val() - F_CKSL_TDC;
							tdcarray[i].F_QTSL_TDC=F_QTSL_TDC;
							tdcarray[i].F_DY_TDC=$(this).val();
						}
					}
				}
			});
		}
		    updateXdTble(JSON.stringify(tdcarray),tdcarray[0].F_ZBID);
		    var zbid =tdcarray[0].F_ZBID;
			selectXdLoad(zbid,function(jsonData){
				//公务舱修改
			var gwcArrays = new Array();
			var jjcArrays = new Array();
		
			var mycars=['确认', '取消'];
			uexWindow.confirm("提交提示","是否确认提交？",mycars);
			uexWindow.cbConfirm = function confirmCallback(opId, dataType, data){
		    if(data==1){
					return;
			}else{
			$.iBoxWait();
//			loadingStart("加载中...", 0);
			var userId = getStorage("userId");
			var jsonValue = {
				"userId":userId,
				"F_PBDBH":zbid,
				"tdcArrays": jsonData,
				"gwcArrays": gwcArrays,
				"jjcArrays": jjcArrays
			};
		var param  = {"Json":JSON.stringify(jsonValue)};
		$.ajax({
        url : updateUrl,
        type : "post",
		data : param,
        dataType:"json",   
        success: function(data){
				 if (data.status==0) {
//						loadingStart("提交成功", 2000);
					    $.iBoxMsg("提交成功");
						updateXd(zbid,2);
						intConter();
					}else if(data.status==1){
						var mycars = ['确认', '取消'];
							uexWindow.confirm("提交失败提示", "是否再次提交？", mycars);
							uexWindow.cbConfirm = function confirmCallback(opId, dataType, data1){
								if (data1 == 0) {
									updateDate1();
								}
							};
						$.iBoxHide();
//						loadingEnd();
//						uexWindow.alert("提示消息", "操作失败请重试", "确定");
					}else{
						 $.iBoxMsg("网络异常，请重试");
//						loadingEnd();
//						 uexWindow.alert("提示消息", "网络异常，请重试", "确定");
					}
		       },
			   error: function(data){
			   	 $.iBoxMsg("网络异常，数据已经保存至本地，请稍后提交！");
//			   	  loadingStart("网络异常，数据已经保存至本地，请稍后提交！", 3000);
			   }
			})
		 }  
	 };
			});
		
	
	}
</script>
</html>
